import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;


public class DateTest {
	
	
	/**
	 * @param args
	 * @return
	 */
	public static void main2(String[] args) {
		Calendar now = Calendar.getInstance();
		SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd");
		Date view = new Date();
		
		view.setTime(now.getTimeInMillis());
		System.out.println(fmt.format(view)+"---现在时间");
		
		
		now.add(Calendar.MONTH, -1);
		now.set(Calendar.DAY_OF_MONTH, 1);
		view.setTime(now.getTimeInMillis());
		System.out.println(fmt.format(view)+"---上月开始");
		
		now.add(Calendar.MONTH, 1);
		view.setTime(now.getTimeInMillis());
		System.out.println(fmt.format(view)+"---本月开始");
		
		now.add(Calendar.DAY_OF_WEEK, -1);
		view.setTime(now.getTimeInMillis());
		System.out.println(fmt.format(view)+"---上月结束");
	}
	
	public static void main(String[] args) {
		System.out.println(new SimpleDateFormat("yyMMddHHmmsssssss").format(new Date()));
	}
	
}
